home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
BUSINESS
/
SALE24.ARJ
/
DBFAST.PRG
< prev
next >
Wrap
Text File
|
1992-06-13
|
768b
|
36 lines
PROCEDURE pack_file
* Packs a database file in the work area
* passed to the procedure
* Syntax:
* DO pack_file WITH x && (x = work area to pack)
PARAMETER work_area
PRIVATE orig_area, temp_file
* Store original work ara for later return
* and select new area
STORE SELECTED(work_area) TO orig_area
* Loop to ensure random file name doesn't
* already exist
STORE ALLTRIM(STR(RANDOM())) + ".DBF" TO temp_file
DO WHILE FILE(temp_file)
STORE ALLTRIM(STR(RANDOM())) + ".DBF" TO ;
temp_file
ENDDO
* PACK file using copy to/from a temp file
COPY TO &temp_file FOR .NOT. DELETED()
ZAP
APPEND FROM &temp_file
DELETE FILE &temp_file
* SELECT original work area before returning
SELECT (orig_area)
RETURN